package com.lucker.controller.domain;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lucker.controller.BaseController;
import com.lucker.ds.model.MDomain;
import com.lucker.ds.model.MUser;
import com.lucker.framework.constant.ResponseBaseModel;
import com.lucker.framework.constant.ResponseResultModel;
import com.lucker.service.domain.MdomainService;
import com.lucker.service.user.MuserService;

@Controller()
@RequestMapping(value = "domain")
public class MDomainController extends BaseController {
	
	@Autowired
	MdomainService mdomainService;
	
	@Autowired
	MuserService muserService;
	
	
	@RequestMapping(value="getall",method = RequestMethod.POST)
	public @ResponseBody  ResponseEntity<?> getall(){
		try {
			List<MDomain> _list = mdomainService.queryAll(new MDomain());
			//List<MUser> _list = muserService.queryAll(new MUser()); 
			return new ResponseEntity<>(new ResponseResultModel<List<MDomain>>(_list),HttpStatus.OK);
		}catch(Exception e) {
			return new ResponseEntity<>(new ResponseBaseModel(29001,e.getMessage()), HttpStatus.OK);
		}
	} 

}
